#include "Tab_Actor.h"
std::map<int, Tab_Actor*> *Tab_Actor::s_pListTab_Actor= NULL;
void Tab_Actor::LoadTable() {
	if(s_pListTab_Actor== NULL){
		s_pListTab_Actor= new std::map<int, Tab_Actor*>();
		std::ifstream ifs("TableData/Tab_Actor.txt");
		std::string strCur;
		while(getline(ifs, strCur)) {
			Tab_Actor *pNewTable = new Tab_Actor();
			pNewTable->LoadData(strCur);
			s_pListTab_Actor->insert(std::make_pair(pNewTable->GetID(), pNewTable));
		}
	}
}
void Tab_Actor::LoadData(const std::string &strData) {
	std::stringstream ss(strData);
	int enumValue = 0;
	ss>>m_ID;
	ss>>m_Level;
	ss>>m_CardName;
	ss>>m_ProfessionType;
	ss>>m_Health;
	ss>>m_PhysicalAttack;
	ss>>m_PhysicalDefense;
	ss>>m_MagicalResistance;
	ss>>m_Speed;
	ss>>m_Description;
	ss>>enumValue;
	m_TargetObjType = (eTargetObjType)enumValue;
	ss>>m_BaseCardIcon;
}
